<%@ page import="model.Product" %>
<%@ page import="java.util.List" %><%--
  Created by IntelliJ IDEA.
  User: New
  Date: 2021/5/11
  Time: 11:10
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>购物车-显示</title>
</head>
<body>

<%
    List<Product> list = (List<Product>) session.getAttribute("list");
%>
<table border="1">

    <tr>
        <th>商品名称</th>
        <th>商品数量</th>
    </tr>
    <%
        for (Product product : list) {
    %>
    <tr>
        <td>
            <%=product.getItemName()%>
        </td>
        <td>
            <%=product.getQuantity()%>
        </td>
    </tr>
    <% }
    %>
</table>
购物车中，共有 <%=list.size()%> 商品
</body>
</html>
